#define quickread
#ifdef quickread
#include <cstdio> 
template <typename T>
inline void read(T& x)
{
    int c=getchar(), f=1; x=0;
    while(c<'0'||'9'<c) {if(c=='-') f=-1; c=getchar();}
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    x*=f;
}
template <typename T>
inline void quickwrite(T x)
{
    if(x<0) putchar('-'), x*=-1;
    if(x>=10) quickwrite(x/10);
    putchar(x%10+'0');
}
#else 
#include <iostream>
#endif
#include <cstring>
#include <cmath>
using namespace std;
#define DEBUG
const int N=1e5+10, M=N<<1;
int e[M], h[N], ne[M], idx;
int n, m;
int ans[N], st[N];
void AddEdge(int a, int b)
{
    e[idx]=b, ne[idx]=h[a], h[a]=idx++;
}

void init()
{
    memset(h, -1, sizeof h);
    read(n), read(m);
    for(int i=1; i<=m; i++) 
    {
        int a, b; read(a), read(b);
        AddEdge(b, a); //反向建图
    }
    // for(int i=1; i<=n; i++) ans[i]=i;
}

void dfs(int u, int fa)
{
    ans[u]=fa;
    for(int i=h[u]; ~i; i=ne[i])
    {
        int v=e[i];
        if(ans[v]) continue;
        dfs(v, fa);
    }
}

void solve()
{
    init();
    for(int i=n; i; i--)
        if(!ans[i]) dfs(i, i);
    for(int i=1; i<=n; i++) printf("%d ", ans[i]);
    puts("");
}

// #undef DEBUG
signed main()
{
    #ifdef DEBUG
        freopen("./in.txt", "r", stdin);
        // freopen("./out.txt", "w", stdout);
    #endif
    #ifndef quickread
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #endif

    int T=1; //scanf("%d", &T);
    while(T--) 
    {
        solve();
    }
    return 0;
}
